package com.wiloon.java8x.basic.enumx;

public class EnumX {
    public static void main(String[] args) {
        System.out.println(ChannelColumn.values());

        for (ChannelColumn channelColumn : ChannelColumn.values()) {
            System.out.println("type:" + channelColumn.type);
            System.out.println("index:" + channelColumn.index());
            System.out.println("name:" + channelColumn.name());
        }
    }

    public enum ChannelColumn implements MemoryColumn {

        CLIENT_ID(TYPE.INDEX), GROUP(TYPE.INDEX), REMOTE_HOST(TYPE.INDEX), REMOTE_PORT(TYPE.INDEX), CHANNEL(TYPE.INDEX);

        private TYPE type = null;

        ChannelColumn(TYPE type) {
            this.type = type;
        }

        public TYPE index() {
            return this.type;
        }


    }

    public interface MemoryColumn {

        enum TYPE {INDEX}

        String name();

        TYPE index();
    }

}
